package dao

import (
	"gitee.com/crack007/goose/db"
	"gorm.io/gorm"
)

func getImDb() *gorm.DB {
	return db.GetDb("im")
}

var UserDao *userDao
var MessageDao *messageDao
var ContactDao *contactDao
var ApplyDao *applyDao
var NoticeDao *noticeDao

func Register() {
	MessageDao = &messageDao{
		Db: getImDb(),
	}
	ContactDao = &contactDao{
		Db: getImDb(),
	}
	UserDao = &userDao{
		db: getImDb(),
	}
	ApplyDao = &applyDao{
		db: getImDb(),
	}
	NoticeDao = &noticeDao{
		db: getImDb(),
	}
}
